package com.lnsf.bookstore.system.shop.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.shop.dao.ShopMapper;
import com.lnsf.bookstore.system.shop.vo.Shop;
import com.lnsf.bookstore.system.shop.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class ShopServiceImpl implements ShopService {

    @Autowired
    private ShopMapper shopMapper;


    @Override
    public int save(Shop shop) {
        return shopMapper.insertSelective(shop);
    }

    @Override
    public Shop queryObject(Integer id) {
        return shopMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return shopMapper.deleteBatch(ids);
    }

    @Override
    public int update(Shop shop) {
        return shopMapper.updateByPrimaryKeySelective(shop);
    }

    @Override
    public PageInfo<Shop> queryList(Map<String, Object> params) {
        return new PageInfo<Shop>(shopMapper.queryList(params));
    }
}
